package edu.sctu.jarime.june.day20150607.suitang;

import java.lang.invoke.VolatileCallSite;

/**
 * Created by Jarime on 2015/6/7.
 */
public class AmyRunnable implements Runnable {
    volatile boolean keepruning;
    @Override
    public void run() {
        System.out.println("开始打架");
        keepruning=true;
        while(keepruning) {
            for (int i = 0; i < 5; i++) {
                System.out.println(Thread.currentThread().getName() + "击打对方[" + i + "]次");
                Thread.yield();//释放资源
            }
        }

        System.out.println("军队战争结束");

    }


    
}
